package com.gzxw.mogublog.web.controller;

import com.gzxw.mogublog.utils.R;
import com.gzxw.mogublog.xo.service.SysDicDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/sysDictData")
public class SysDictDataController {

    @Autowired
    private SysDicDataService dicDataService;

    // 根据字典类型获取字典数据
    @PostMapping("/getListByDictTypeList")
    public R getListByDictTypeList(@RequestBody List<String> dictTypeList) {

        Map<String, Object> result = dicDataService.getListByDictTypeList(dictTypeList);

        return R.success("200",result);
    }

    // 根据字典类型获取字典数据
    @PostMapping("/getListByDictType")
    public R getListByDictType(@RequestParam("dictType") String dictType) {
        Map<String, Object> result = dicDataService.getListByDictType(dictType);
        return R.success("200",result);
    }
}
